﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuanLyNguoiDung.ascx.cs"
    Inherits="Solutions.Admin.QuanLyNguoiDung.QuanLyNguoiDung" %>
<style type="text/css">
    .marginleft10 {
        position: relative;
        float: left;
        margin-left: 10px;
    }

    .dxgvTable_Aqua caption {
        height: 30px !important;
        line-height: 30px;
        font-weight: bold;
    }

    .redLabel {
        color: Red;
    }
</style>


<table>
    <tr>
        <td>
            <dx:ASPxButton ID="btnThemMoi" runat="server" AutoPostBack="False" EncodeHtml="False"
                Height="22px" Text="Thêm mới" OnClick="btnThemMoi_Click">
                <Image Url="../Skins/style/IMG/icon/Add.png" Width="16px" Height="16px" />
            </dx:ASPxButton>
        </td>
        <td style="float: left; margin-left: 5px;">
            <dx:ASPxButton ID="btnXuatExcel" runat="server" AutoPostBack="False" EncodeHtml="False"
                Height="22px" Text="Xuất Excel" OnClick="XuatExcelClick">
                <Image Url="../Skins/style/IMG/icon/excel.png" Width="16px" Height="16px" />
            </dx:ASPxButton>
        </td>
    </tr>
</table>
<dx:ASPxTextBox runat="server" Visible="False" ID="hdIdNguoiDung"></dx:ASPxTextBox>
<dx:ASPxTextBox runat="server" Visible="False" ID="hdId"></dx:ASPxTextBox>
<dx:ASPxTextBox runat="server" Visible="False" ID="hdVaiTroId"></dx:ASPxTextBox>
<dx:ASPxGridView ID="grdQuanLyNguoiDung" runat="server" Width="100%" OnRowCommand="grdQuanLyNguoiDung_RowCommand"
    KeyFieldName="pk_iNguoiDungID" Caption="Danh sách người dùng">
    <Columns>
        <dx:GridViewDataTextColumn Caption="STT" VisibleIndex="0" Width="40" HeaderStyle-HorizontalAlign="Center"
            CellStyle-HorizontalAlign="Center" CellStyle-Font-Bold="true" HeaderStyle-Font-Bold="true">
            <DataItemTemplate>
                <%#Container.ItemIndex + 1 %>
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="sTenDangNhap" Width="100" Caption="Tên đăng nhập"
            VisibleIndex="1" HeaderStyle-Font-Bold="true" />
        <dx:GridViewDataTextColumn FieldName="sHoTen" Width="200" Caption="Tên người dùng"
            VisibleIndex="1" HeaderStyle-Font-Bold="true" />
        <dx:GridViewDataTextColumn FieldName="sSoDienThoai" Width="100" Caption="Số điện thoại"
            VisibleIndex="2" HeaderStyle-Font-Bold="true" />
        <dx:GridViewDataTextColumn FieldName="sEmail" Width="200" Caption="Email" VisibleIndex="2"
            HeaderStyle-Font-Bold="true" />
        <dx:GridViewDataTextColumn FieldName="sGhiChu" Width="200" Caption="Ghi chú" VisibleIndex="2"
            HeaderStyle-Font-Bold="true" />
        <dx:GridViewDataTextColumn Caption="Edit" VisibleIndex="3" Width="30" HeaderStyle-HorizontalAlign="Center"
            CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true">
            <DataItemTemplate>
                <asp:ImageButton ID="imgEdit" runat="server" CommandName="Edit" ImageUrl="../Skins/style/IMG/icon/Edit.png"
                    ClientIDMode="Static" />
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn Caption="Delete" VisibleIndex="4" Width="30" HeaderStyle-HorizontalAlign="Center"
            CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true">
            <DataItemTemplate>
                <asp:ImageButton ID="imgDel" runat="server" CommandName="Delete" ImageUrl="../Skins/style/IMG/icon/Delete.png"
                    ClientIDMode="Static" />
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn Caption="Phân quyền" VisibleIndex="4" Width="30" HeaderStyle-HorizontalAlign="Center"
            CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true">
            <DataItemTemplate>
                <asp:ImageButton ID="imgRole" runat="server" CommandName="Roles" ImageUrl="../Skins/style/IMG/icon/Roles.png"
                    ClientIDMode="Static" />
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn Caption="Reset mật khẩu" VisibleIndex="4" Width="30" HeaderStyle-HorizontalAlign="Center"
            CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true">
            <DataItemTemplate>
                <asp:ImageButton ID="imgResetPass" runat="server" CommandName="ResetPass" ImageUrl="../Skins/style/IMG/icon/ResetPass.png"
                    ClientIDMode="Static" />
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
    </Columns>
    <Styles>
        <AlternatingRow Enabled="true" />
    </Styles>
    <SettingsBehavior AllowSelectByRowClick="true" />
    <Settings VerticalScrollableHeight="430" ShowGroupPanel="false" ShowFilterRow="true" />
    <SettingsPager Position="Bottom" PageSize="20">
        <PageSizeItemSettings Items="10, 20, 50" />
    </SettingsPager>
</dx:ASPxGridView>
<dx:ASPxTextBox runat="server" ID="txtpk_iDonViID" Visible="false">
</dx:ASPxTextBox>
<dx:ASPxTextBox runat="server" ID="VAI_TRO_ID" Visible="false">
</dx:ASPxTextBox>
<dx:ASPxPopupControl ID="wdsQuanLyNguoiDung" runat="server" ClientInstanceName="wdsQuanLyNguoiDung"
    Width="480px" Height="280px" Modal="True" CloseAction="CloseButton" AllowDragging="True"
    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" HeaderText="Quản lý người dùng"
    ClientIDMode="Static">
    <ContentCollection>
        <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
            <table style="margin-left: 20px; margin-top: 5px;">
                <tr>
                    <td>
                        <p style="width: 120px;">
                            Đơn vị <span class="redLabel">(*)</span>:
                        </p>
                    </td>
                    <td>
                        <dx:ASPxComboBox runat="server" ID="cboDonVi" ValueField="pk_iDonViID" TextField="sTenDonVi"
                            EnableCallbackMode="true" IncrementalFilteringMode="StartsWith" Height="26px"
                            Width="270px" RightToLeft="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p style="width: 120px;">
                            Họ tên :
                        </p>
                    </td>
                    <td>
                        <dx:ASPxTextBox runat="server" ID="txtHoTen" Width="270px" Height="26px" MaxLength="50">
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p style="width: 120px;">
                            Tên đăng nhập <span class="redLabel">(*)</span>:
                        </p>
                    </td>
                    <td>
                        <dx:ASPxTextBox runat="server" ID="txtTenDangNhap" Width="270px" Height="26px" MaxLength="50">
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p style="width: 120px;">
                            Điện thoại:
                        </p>
                    </td>
                    <td>
                        <dx:ASPxTextBox runat="server" ID="txtDienThoai" Width="270px" Height="26px" MaxLength="100">
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p style="width: 120px;">
                            Email<span class="redLabel">(*)</span>:
                        </p>
                    </td>
                    <td>
                        <dx:ASPxTextBox runat="server" ID="txtEmail" Width="270px" Height="26px" MaxLength="100">
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p style="width: 120px;">
                            Ghi chú:
                        </p>
                    </td>
                    <td>
                        <dx:ASPxMemo runat="server" ID="txtGhiChu" Width="270px" Height="71px" MaxLength="100">
                        </dx:ASPxMemo>
                    </td>
                </tr>
            </table>
            <table style="margin-top: 10px;">
                <tr>
                    <td style="width: 240px;"></td>
                    <td>
                        <dx:ASPxButton ID="btnLuuLai" runat="server" AutoPostBack="False" Text="Lưu lại"
                            Width="80px" OnClick="btnLuuLai_Click">
                            <Image Url="../Skins/style/IMG/icon/Save.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                        <dx:ASPxButton ID="btnLuuSua" runat="server" AutoPostBack="False" Text="Lưu lại"
                            Width="80px" OnClick="btnLuuSua_Click" Visible="false">
                            <Image Url="../Skins/style/IMG/icon/SaveEdit.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                    <td style="position: relative; float: left; margin-left: 10px;">
                        <dx:ASPxButton ID="btnDong" runat="server" AutoPostBack="False" ClientInstanceName="btnDong"
                            Text="Đóng" Width="80px">
                            <Image Url="../Skins/style/IMG/icon/Close.png" Width="16px" Height="16px" />
                            <ClientSideEvents Click="function(s, e) {wdsQuanLyNguoiDung.Hide();}" />
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>
<dx:ASPxPopupControl ID="wdsPhanQuyen" runat="server" ClientInstanceName="popupControlPhanQuyen"
    Width="680px" Height="480px" Modal="True" CloseAction="CloseButton" AllowDragging="True"
    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" HeaderText="Phân quyền nươời dùng"
    ClientIDMode="Static">
    <ContentCollection>
        <dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server">
            <dx:ASPxButton ID="btnAddNewPhanQuyen" runat="server" AutoPostBack="False" EncodeHtml="False"
                Height="22px" Text="Thêm mới" OnClick="btnAddNewPhanQuyen_Click">
                <Image Url="../Skins/style/IMG/icon/Add.png" Width="16px" Height="16px" />
            </dx:ASPxButton>
            <br />
            <table style="margin-left: 5px;">
                <tr>

                    <td style="width: 120px;">Tên người dùng: 
                        
                    </td>
                    <td>
                        <asp:Label ID="lblHoTenNguoiDung" runat="server" Text="Phạm Văn An"></asp:Label>
                    </td>

                </tr>
                <tr>
                    <td style="width: 120px; float: left; margin-top: 20px;">Tên đăng nhập: 
                        
                    </td>
                    <td>
                        <asp:Label ID="lblTenDangNhapNguoiDung" runat="server" Text="admin1"></asp:Label>
                    </td>
                </tr>
            </table>
            <table style="margin-left: 5px; margin-top: 10px">
                <tr>
                    <td>
                        <dx:ASPxGridView ID="grdDanhSachQuyen" runat="server" Width="100%" OnRowCommand="grdDanhSachQuyen_RowCommand"
                            KeyFieldName="pk_iVaiTroNguoiDungID" Caption="Danh sách quyền người dùng">
                            <Columns>
                                <dx:GridViewDataTextColumn Caption="STT" VisibleIndex="0" Width="40" HeaderStyle-HorizontalAlign="Center"
                                    CellStyle-HorizontalAlign="Center" CellStyle-Font-Bold="true" HeaderStyle-Font-Bold="true">
                                    <DataItemTemplate>
                                        <%#Container.ItemIndex + 1 %>
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="sTenVaiTro" Width="100" Caption="Vai trò"
                                    VisibleIndex="1" HeaderStyle-Font-Bold="true" />
                                <dx:GridViewDataTextColumn FieldName="sTenDonVi" Width="200" Caption="Đơn vị"
                                    VisibleIndex="1" HeaderStyle-Font-Bold="true" />
                                <dx:GridViewDataTextColumn FieldName="sGhiChu" Width="200" Caption="Ghi chú" VisibleIndex="2"
                                    HeaderStyle-Font-Bold="true" />
                                <dx:GridViewDataTextColumn Caption="Edit" VisibleIndex="3" Width="30" HeaderStyle-HorizontalAlign="Center"
                                    CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true">
                                    <DataItemTemplate>
                                        <asp:ImageButton ID="imgPQEdit" runat="server" CommandName="Edit" ImageUrl="../Skins/style/IMG/icon/Edit.png"
                                            ClientIDMode="Static" />
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Delete" VisibleIndex="4" Width="30" HeaderStyle-HorizontalAlign="Center"
                                    CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true">
                                    <DataItemTemplate>
                                        <asp:ImageButton ID="imgPQDel" runat="server" CommandName="Delete" ImageUrl="../Skins/style/IMG/icon/Delete.png"
                                            ClientIDMode="Static" />
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <Styles>
                                <AlternatingRow Enabled="true" />
                            </Styles>
                            <SettingsBehavior AllowSelectByRowClick="true" />
                            <Settings VerticalScrollableHeight="430" ShowGroupPanel="false" ShowFilterRow="true" />
                            <SettingsPager Position="Bottom" PageSize="20">
                                <PageSizeItemSettings Items="10, 20, 50" />
                            </SettingsPager>
                        </dx:ASPxGridView>
                    </td>
                </tr>
            </table>
            <table style="margin-left: 5px; margin-top: 10px">
                <tr style="float: left; margin-bottom: 10px;">
                    <td style="width: 130px; vertical-align: top;">Đơn vị: &nbsp;
                    </td>
                    <td style="width: 260px; vertical-align: top;">
                        <dx:ASPxComboBox runat="server" ID="cboDonViQuanLy"
                            ValueField="pk_iDonViID" TextField="sTenDonVi" EnableCallbackMode="true" IncrementalFilteringMode="StartsWith" Height="25px" Width="520px" RightToLeft="False" />
                    </td>
                </tr>
                <tr style="float: left; margin-bottom: 10px;">
                    <td style="width: 130px; vertical-align: top;">Vai trò: &nbsp;
                    </td>
                    <td style="width: 260px; vertical-align: top;">
                        <dx:ASPxComboBox runat="server" ID="cboQuyen"
                            ValueField="pk_iVaiTroID" TextField="sTenVaiTro" EnableCallbackMode="true" IncrementalFilteringMode="StartsWith" Height="25px" Width="520px" RightToLeft="False" />
                    </td>
                </tr>
                <tr style="float: left; margin-bottom: 10px;">
                    <td style="width: 130px; vertical-align: top;">Ghi chú : &nbsp;
                    </td>
                    <td style="width: 260px; vertical-align: top;">
                        <dx:ASPxMemo ID="txtsGhiChu" runat="server" Width="520px" Height="71px">
                        </dx:ASPxMemo>
                    </td>
                </tr>
            </table>
            <table style="margin-top: 10px;">
                <tr>
                    <td style="width: 240px;"></td>
                    <td>
                        <dx:ASPxButton ID="btnLuuGanQuyen" runat="server" AutoPostBack="False" Text="Lưu lại"
                            Width="80px" OnClick="btnAddPhanQuyen_click">
                            <Image Url="../Skins/style/IMG/icon/Save.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                        <dx:ASPxButton ID="btnLuuLaiQuyen" runat="server" AutoPostBack="False" Text="Lưu lại"
                            Width="80px" OnClick="btnUpdatePhanQuyen_click" Visible="false">
                            <Image Url="../Skins/style/IMG/icon/SaveEdit.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                    <td style="position: relative; float: left; margin-left: 10px;">
                        <dx:ASPxButton ID="btnDongQuyen" runat="server" AutoPostBack="False" ClientInstanceName="btnDong"
                            Text="Đóng" Width="80px">
                            <Image Url="../Skins/style/IMG/icon/Close.png" Width="16px" Height="16px" />
                            <ClientSideEvents Click="function(s, e) {popupControlPhanQuyen.Hide();}" />
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>
<dx:ASPxPopupControl ID="wdsThongBaoDoiMatKhau" runat="server" ClientInstanceName="popupControl"
    Width="300px" Height="230px" Modal="True" CloseAction="CloseButton" AllowDragging="True"
    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" HeaderText="Thông báo"
    ClientIDMode="Static">
    <ContentCollection>
        <dx:PopupControlContentControl ID="PopupControlContentControl3" runat="server">
            <br />
            <table style="margin-left: 40px;">
                <tr>
                    <td>
                        <p>
                            Xác nhận
                        </p>
                    </td>
                </tr>
            </table>
            <table style="margin-top: 50px;">
                <tr>
                    <td style="width: 240px;"></td>
                    <td>
                        <dx:ASPxButton ID="ASPxButton4" runat="server" AutoPostBack="False" Text="Lưu lại"
                            Width="80px" OnClick="btnLuuLai_Click">
                            <Image Url="../Skins/style/IMG/icon/Save.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                    <td style="position: relative; float: left; margin-left: 10px;">
                        <dx:ASPxButton ID="ASPxButton6" runat="server" AutoPostBack="False" ClientInstanceName="btnDong"
                            Text="Đóng" Width="80px">
                            <Image Url="../Skins/style/IMG/icon/Close.png" Width="16px" Height="16px" />
                            <ClientSideEvents Click="function(s, e) {popupControl.Hide();}" />
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>
